package com.zh.device.controller;

import com.zh.common.utils.PageUtils;
import com.zh.common.utils.Query;
import com.zh.common.utils.R;
import com.zh.device.domain.DeviceBindingDO;
import com.zh.device.domain.DeviceBindingDOVO;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * 
 * 
 * @author madara
 * @email 54925881@qq.com
 * @date 2019-07-24 12:35:13
 */
 
@Controller
@RequestMapping("/device/deviceBinding")
public class DeviceBindingController {


	@GetMapping()
	String deviceBinding(){

	    return "device/deviceBinding/deviceBinding";
	}
	@ResponseBody
	@GetMapping("/list")
	public PageUtils list(@RequestParam Map<String, Object> params){
		//查询列表数据
        Query query = new Query(params);
		return null;
	}

	@GetMapping("/edit/{id}")
	String edit(@PathVariable("id") Integer id,Model model){


	    return "device/deviceBinding/edit";
	}
	
	/**
	 * 保存
	 */
	@ResponseBody
	@PostMapping("/save")
	public R save(DeviceBindingDOVO deviceBinding){

		return R.error();
	}
	/**
	 * 修改
	 */
	@ResponseBody
	@RequestMapping("/update")
	public R update(DeviceBindingDO deviceBinding){

		return R.ok();
	}
	
	/**
	 * 删除
	 */
	@PostMapping( "/remove")
	@ResponseBody
	public R remove( Integer id){

		return R.error();
	}
	
	/**
	 * 删除
	 */
	@PostMapping( "/batchRemove")
	@ResponseBody
	public R remove(@RequestParam("ids[]") Integer[] ids){

		return R.ok();
	}

	/**
	 *
	 * @return
	 */
	@GetMapping("/ztree")
	public String ztree() {
		return "device/deviceBinding/ztree";
	}



	/**
	 *
	 * @return
	 */
	@GetMapping("/site")
	public String site() {
		return "device/site/site";
	}


}
